﻿// Decompiled with JetBrains decompiler
// Type: DnProcessSimulateCommands.ContinuousMacro.CApCMDisplayContinuousMacrosCmd
// Assembly: DnProcessSimulateCommands, Version=2402.0.0.890, Culture=neutral, PublicKeyToken=null
// MVID: A885D881-AEDF-447E-852A-6F13102E089C
// Assembly location: C:\Program Files\Tecnomatix_2402\eMPower\DotNetCommands\DnProcessSimulateCommands.dll

using DnProcessSimulateCommands.ContinuousMacro.Resources;
using EngineeringInternalExtension;
using Tecnomatix.Engineering;
using Tecnomatix.Engineering.Ui;


namespace DnProcessSimulateCommands.ContinuousMacro;

public class CApCMDisplayContinuousMacrosCmd : TxToggleButtonCommand
{
  private CApCMDisplayContinuousMacrosEnabler enabler;
  private CApCMContinuousMacroDisplayManager manager;

  public virtual string Category => ContinuousMacroResources.CMD_CATEGORY;

  public virtual string Name => ContinuousMacroResources.DISPLAY_CONTINUOUS_MACRO;

  public virtual string Tooltip => ContinuousMacroResources.CMD_TOOLTIP_DISPLAY_COMMAND;

  public virtual string Bitmap => "ContinuousMacro.Resources.DisplayContinuousMacro.bmp";

  public virtual string LargeBitmap => "ContinuousMacro.Resources.DisplayContinuousMacro_LARGE.png";

  public virtual string Description => ContinuousMacroResources.CMD_DESCRIPTION_DISPLAY_COMMAND;

  public virtual ITxCommandEnabler CommandEnabler => (ITxCommandEnabler) this.enabler;

  public virtual bool Connect()
  {
    this.manager = new CApCMContinuousMacroDisplayManager(this);
    this.enabler = new CApCMDisplayContinuousMacrosEnabler(this);
    return true;
  }

  public virtual void Disconnect() => this.manager.Delete();

  public virtual ITxImage Image => (ITxImage) TxImageManager.GetImageByKey("DisplayMacros");

  public virtual void Execute(object cmdParams)
  {
    if (!TxCommandLicenser.DisplayContinuousMacroLicense)
      TxMessageBoxEx.ShowNoLicenseError(((TxButtonCommand) this).Name);
    else
      this.manager.Toggle(cmdParams);
  }

  public virtual bool Push => this.IsPushed;

  public bool IsPushed { get; internal set; }
}
